<!doctype html>
<html>
<?php echo $this->fetch('head.html'); ?>

<body style="background:none;">
<div class="win_openShop">
  <div class="w_top">
    <div id="tabs1" class="li cur">
      <div class="ico i1"></div>
      <div class="txt">了解66速购</div>
    </div>
    <div class="line"></div>
    <div id="tabs2" class="li">
      <div class="ico i2"></div>
      <div class="txt">填写申请</div>
    </div>
    <div class="line"></div>
    <div id="tabs3" class="li">
      <div class="ico i3"></div>
      <div class="txt">申请成功</div>
    </div>
  </div>
  <div class="w_main">
    <div class="step w_step1">
     <?php $this->assign("a",M("dataapi")->getword("夜猫店申请说明")); ?>
     <?php echo $this->_var['a']['content']; ?>
    </div>
    <div class="step w_step2" style="display:none;">
    	<form id="apply_form">
      <ul class="list">
        <li><span class="label">楼栋：</span><?php echo $this->_var['scparent']['title']; ?> <?php echo $this->_var['site_city']['title']; ?> <input type="hidden" name="sc_id" id="sc_id" value="<?php echo $this->_var['site_city']['sc_id']; ?>"></li>
        <li><span class="label">姓名：</span>
          <input type="text"  name="nickname" class="inp">
        </li>
        <li><span class="label">性别：</span>
          <input type="radio" name="gender" value="1" id="man_label">
          <label for="man_label">男</label>
          &nbsp;
          <input type="radio" name="gender" value="2" id="women_label">
          <label for="women_label">女</label>
        </li>
        <li><span class="label">手机：</span>
          <input type="text" name="telephone" class="inp">
        </li>
      </ul>
      </form>
    </div>
    <div class="step w_step3" style="display:none;">申请成功，请静候佳音</div>
  </div>
  <div class="w_bot"> <a href="javascript:;" class="nextbtn">下一步</a> </div>
</div>
<script>
//开店步骤
var step = 1;
var step1=$(".w_step1");
var step2=$(".w_step2");
var step3=$(".w_step3");
var nextbtn=$(".nextbtn");
nextbtn.on('click', function(){
	if (step == 1) {
		
		step1.hide();
		step2.show();
		step=2;
		nextbtn.html('提交申请');
		$("#tabs1").removeClass("cur");
		$("#tabs2").addClass("cur");
	}else if(step == 2)
	{
		$.post("/index.php?m=ymdian_apply&a=save&ajax=1",$("#apply_form").serialize(),function(data){
			if(data.error){
				skyToast(data.message);
			}else{
				step2.hide();
				step3.show();
				step = 3;
				nextbtn.html('关闭');
				$("#tabs2").removeClass("cur");
				$("#tabs3").addClass("cur");
			}
		},"json");
		
	}else
	{
		 
		window.parent.hidewin();
	}
});
</script>
</body>
</html>
